import type { PaginationQuery, PaginationResponse } from './common'

// 设备类型
export interface Device {
  id: number
  code: string
  name: string
  type: DeviceType
  deviceType: DevicePortType
  status: DeviceStatus
  location: string
  currentCapacity: number
  maxCapacity: number
  todayDisposals: number
  totalDisposals: number
  installedAt: string
  lastReportAt?: string
  createdAt: string
  updatedAt: string
}

// 库存设备
export interface InventoryDevice {
  id: number
  code: string
  wasteType: WasteType
  deviceType: DevicePortType
  status: InventoryStatus
  warehouse: string
  purchaseDate: string
  supplier: string
  price: number
  remark?: string
  createdAt: string
  updatedAt: string
}

// 设备类型
export type DeviceType = 'paper' | 'textile' | 'mixed'

// 设备投口类型
export type DevicePortType = 'single' | 'double'

// 设备状态
export type DeviceStatus = 'online' | 'offline' | 'full' | 'error' | 'maintenance'

// 库存状态
export type InventoryStatus = 'in_stock' | 'in_use' | 'maintenance' | 'scrapped'

// 回收类型
export type WasteType = 'paper' | 'plastic' | 'metal' | 'glass' | 'textile' | 'mixed'

// 设备查询参数
export interface DeviceQuery extends PaginationQuery {
  keyword?: string
  status?: DeviceStatus
  type?: DeviceType
  location?: string
  dateRange?: string[]
}

// 库存设备查询参数
export interface InventoryDeviceQuery extends PaginationQuery {
  keyword?: string
  status?: InventoryStatus
  wasteType?: WasteType
  deviceType?: DevicePortType
  warehouse?: string
  dateRange?: string[]
}

// 设备表单
export interface DeviceForm {
  name: string
  code: string
  type: DeviceType
  location: string
  maxCapacity: number
  status: DeviceStatus
  installedAt: string
  remark?: string
}

// 库存设备表单
export interface InventoryDeviceForm {
  code: string
  wasteType: WasteType
  deviceType: DevicePortType
  warehouse: string
  purchaseDate: string
  supplier: string
  price: number
  remark?: string
}

// 批量导入结果
export interface ImportResult {
  success: number
  failed: number
  errors: Array<{
    row: number
    message: string
  }>
}